<script src="<{$config.weburl}>/script/jquery-1.4.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
function display(id,type)
{
	if(type == 'hide')
		$("#"+id).hide();
	else
		$("#"+id).show();
}
</script>
<header>
	<div class="nav-w">
    	<section class="nav-s"><a href="<{$config.weburl}>/main.php"><nav>用户中心</nav></a></section>
    	<section class="nav-c"><span>发票信息</span></section>
    	<section class="nav-e"></section>
    </div>
</header>
<link href="<{$config.weburl}>/templates/wap/css/invoice.css" rel="stylesheet" type="text/css" />
<section class="orderadder">
<{if $smarty.get.type=='add' or $smarty.get.type=='edit'}>
    <form id="form" name="form" action="" method="post">
    <input type="hidden" value="<{$de.id}>" name="id">
    <input type="hidden" value="<{$smarty.get.t}>" name="ty">
    <input type="hidden" value="<{if $de.id}>edit<{else}>add<{/if}>" name="submit">
    <dl>
        <dt>发票类型：</dt>
        <dd>&nbsp;&nbsp;&nbsp;&nbsp;
        <input onclick="display('tbody','hide');display('rise','show')" type="radio" id="type0" value="0" name="type" <{if $de.type==0 or !$de.id}>checked="checked"<{/if}> /><label onclick="display('tbody','hide');display('rise','show')" for="type0"><{$lang.itype.0}></label>
        <input onclick="display('tbody','show');display('rise','hide');display('company','hide')" type="radio" id="type1" value="1" name="type" <{if $de.type==1}>checked="checked"<{/if}> /><label onclick="display('tbody','show');display('rise','hide')" for="type1"><{$lang.itype.1}></label>
        </dd>
    </dl>
    <div id="tbody" <{if $de.type==0 or !$de }>style="display:none"<{/if}>>	
    <dl>
        <dt>单位名称:</dt>
        <dd><input type="text" class="text w300" name="company1" value="<{$de.company}>" /></dd>
    </dl>
    <dl>
        <dt>纳税人识别号:</dt>
        <dd><input type="text" class="text w300" name="number" value="<{$de.number}>" /></dd>
    </dl>
    <dl>
        <dt>注册地址:</dt>
        <dd><input type="text" class="text w300" name="address" value="<{$de.address}>" /></dd>
    </dl>
    <dl>
        <dt>注册电话:</dt>
        <dd><input type="text" class="text w300" name="telephone" value="<{$de.telephone}>" /></dd>
    </dl>
    <dl>
        <dt>开户银行:</dt>
        <dd><input type="text" class="text w300" name="bank" value="<{$de.bank}>" /></dd>
    </dl>
    <dl>
        <dt>银行帐户:</dt>
        <dd><input type="text" class="text w300" name="account" value="<{$de.account}>" /></dd>
    </dl>
    </div> 
    
    <dl id="rise" <{if $de.type==1 }>style="display:none"<{/if}> >
        <dt>发票抬头：</dt>
        <dd>&nbsp;&nbsp;&nbsp;&nbsp;
        <input onclick="display('company','hide')" type="radio" id="rise0" value="0" name="rise" <{if $de.rise==0 or !$de.id}>checked="checked"<{/if}> /><label onclick="display('company','hide')" for="rise0"><{$lang.irise.0}></label>
<input onclick="display('company','show')" type="radio" id="rise1" value="1" name="rise" <{if $de.rise==1}>checked="checked"<{/if}> /><label onclick="display('company','show')" for="rise1"><{$lang.irise.1}></label>
        </dd>
    </dl>
    <dl id="company" <{if $de.rise==0 or !$de or $de.type==1 }>style="display:none"<{/if}>>
        <dt>单位名称：</dt>
        <dd><input type="text" class="text w300" name="company" value="<{$de.company}>" /></dd>
    </dl>
    <dl>
        <dt>发票内容：</dt>
        <dd>&nbsp;&nbsp;&nbsp;&nbsp;
        <{foreach item=list key=num from=$lang.icontent}>
<input type="radio" id="content<{$num}>" value="<{$num}>" name="content" <{if $de.content==$num or !$num}>checked="checked"<{/if}> /><label for="content<{$num}>"><{$list}></label>
        <{/foreach}>
        </dd>
    </dl>
    <dl>
        <dt>设为默认：</dt>
        <dd>&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="default" value="1" <{if $de.default==2 }>checked="checked"<{/if}> /></dd>
    </dl>
   	<input type="submit" value="保存" class="submit">
    </form>
<{else}>
    <ul>
        <{foreach item=list key=num from=$invoice}>
        <li>
        	<a href="<{$config.weburl}>/main.php?m=member&s=admin_invoice&id=<{$list.id}>&type=edit<{if $smarty.get.t}>&t=<{$smarty.get.t}><{/if}>">
            <p>发票类型：<{foreach item=v key=num from=$lang.itype}><{if $num==$list.type}><{$v}><{/if}><{/foreach}>
            <{if $list.default==2}><span>默认</span><{/if}>
            </p>
            <{if $list.type!=1 }>
            <p>发票抬头：<{foreach item=v key=num from=$lang.irise}><{if $num==$list.rise}><{$v}><{/if}><{/foreach}></p>
            <{if $list.rise==1 && $list.type==0}><p class="f14">单位名称：<{$list.company}></p><{/if}>
            <{/if}>
            <p>发票内容：<{foreach item=v key=num from=$lang.icontent}><{if $num==$list.content}><{$v}><{/if}><{/foreach}></p>
            <{if $list.type==1}>
            <p>单位名称：<{$list.company}>&nbsp;&nbsp;纳税人识别号：<{$list.number}></p>
            <p>注册地址：<{$list.address}>&nbsp;&nbsp;注册电话：<{$list.telephone}></p>
            <p>开户银行：<{$list.bank}>&nbsp;&nbsp;银行帐户：<{$list.account}></p>
            <{/if}>
            </a>
            <a class="del" href="<{$config.weburl}>/main.php?m=member&s=admin_invoice&edid=<{$list.id}>">删除</a>
        </li>  
        <{/foreach}>
    </ul>
    <div class="add"><a href="main.php?m=member&s=admin_invoice&type=add&type=add<{if $smarty.get.t}>&t=<{$smarty.get.t}><{/if}>">添加新发票</a></div>
<{/if}>
</section>